<template>
	<div id="app">
    <form @submit.prevent="setMessage">
      <div>
        <label for="name">姓名：</label>
        <input type="text" id="name" v-model="message.name">
      </div>
      <div>
        <label for="psd">密码：</label>
        <input type="password" id="psd" v-model="message.password">
      </div>
      <button>登录</button>
    </form>
	</div>
</template>

<script>
export default {
  data(){
    return{
      message:{
        name:"",
        password:""
      }
    }
  },
  methods:{
    setMessage(){
      console.log(this.message);
    }
  }
};
</script>
<style>
</style>